require(['./config'], () => {
    require(['template', 'url', 'dropdown', 'request','header', 'footer', 'dropdown'], (template, url, dropdown,request) => {
        class Life {
            constructor () {
                this.left()
                this.getTab()
                // this.right()

            }
            left () {
                $.get(`${url.rap2BaseUrl}/list_left/get`, resp => {
                    if (resp.code === 200) {
                      // const { list } = resp.body

                      const list =  {...resp.body}
                      this.list = list
                      console.log(list)
                      $('#List').html(template('lifeTemplate', { ...this.list }))
                    }
                  })
            }



            getTab() {
              request.getTabs().then(resp => {
                if (resp.code === 200) {
                  let {list} = resp.data
                  // list = list.slice(1)
                  const id = window.location.hash.slice(1)
                  $('.focus_l').html(template('tabsTemplate', { list, id }))
                }
              })
            }


            /*right () {
                $.get(`${url.rap2BaseUrl}/list_right/get`, resp => {
                    if (resp.code === 200) {
                      const { list } = resp.body 
                      $('#r_ul').html(template('r_list', { list }))
                    }
                  })
            }*/
        }
        new Life()
    })
})